﻿#ifndef COMMON_H
#define COMMON_H

//#include <Image>

#include <math.h>
#include "core.hpp"
#include <sstream>


class Pose
{
public:
    double x,y,z;
    double rx,ry,rz;
};

Pose genPose(double x, double y, double z, double rx, double ry, double rz);

Pose PoseMat(cv::Mat m);

typedef struct _Move
{
    Pose p;
    int moveType;
    int speed;
} Move;

Move genMove(double x, double y, double z, double rx,double ry, double rz,
             int moveType, int speed);

Move genMove(Pose p, int moveType, int speed);

cv::Mat MatPose(Pose p);
cv::Mat MatRx(double rx);
cv::Mat MatRy(double ry);
cv::Mat MatRz(double rz);

bool checkSolution(cv::Mat m, double rx, double ry, double rz);

//两个位姿的相似度
double distPoseT(Pose p1, Pose p2);//x,y,z差距
double distPoseR(Pose p1, Pose p2);//rx,ry,rz差距

//将一个Pose转换成string
std::string pose2Str(Pose p);

////将QImage 转换成 cv::Mat
//cv::Mat qimage2mat(QImage src);
////将cv::Mat 转换为 QImage
//QImage mat2qimage(cv::Mat src);
//
////将QImage 转换成 HImage
//cv::Mat qimage2mat(QImage src);
////将HImage 转换为 QImage
//QImage mat2qimage(cv::Mat src);

#endif // COMMON_H
